Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
"!=" y "está en blanco" no funcionan como se esperaba

¿Pueden ayudarme a corregir el código del script de la aplicación?

 function sendEmails() { var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var lr = ss.getLastRow (); for (var i=2;i<=lr;i++) { var currentemail =ss.getRange (i,1).getValue(); var currentclasstitle =ss.getRange (i,3).getValue(); var currentcondition =ss.getRange (i,4).getValue(); var Confirmation =ss.getRange (i,4).setValue("Email Sent"); if (currentcondition!="Email Sent"&& currentemail !=""){ MailApp.sendEmail(currentemail,currentclasstitle+ " Invoice Request Updates ","Hi");} else if (currentemail!="") {Confirmation} } }

todo lo que no se muestra correctamente después de la declaración else if

lo que quiero es

**

  • SI A3 está EN BLANCO QUIERO que D3 también esté EN BLANCO

**

según mi código anterior, incluso si A3 está en blanco, D3 completa el correo electrónico enviado

Captura de pantalla de Google SS

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Eso es porque está configurando el valor en D3 antes de su declaración If

Reemplace esto: -

 var Confirmation =ss.getRange (i,4).setValue("Email Sent"); if (currentcondition!="Email Sent"&& currentemail !=""){ MailApp.sendEmail(currentemail,currentclasstitle+ " Invoice Request Updates ","Hi");} else if (currentemail!="") {Confirmation}

con este:-

 const confirmation = ss.getRange (i,4) if (currentemail !== "" && currentcondition !== "Email Sent" ) { MailApp.sendEmail(currentemail,currentclasstitle+ " Invoice Request Updates ","Hi"); confirmation.setValue("Email Sent"); }

Referencia:

si... más

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!